package lab02.test36;

public class Test36 {
    public static void main(String[] args) {
        Student[] students = new Student[5];
        students[0] = new Undergraduate("张三", "本科生", 90, 95, 100);
        students[1] = new Undergraduate("李四", "本科生", 80, 85, 90);
        students[2] = new Postgraduate("王五", "研究生", 82, 85, 88);
        students[3] = new Undergraduate("赵六", "本科生", 75, 82, 87);
        students[4] = new Postgraduate("陈七", "研究生", 80, 82, 84);

        for (int i = 0; i < students.length; i++) {
            System.out.println(students[i].name + "\t" + students[i].category + "\t" +
                    students[i].chiense + "," + students[i].math + "," + students[i].english);
        }

        System.out.println("----------------------------");
        //打印学生信息。
        for (int i = 0; i < students.length; i++) {
            students[i].avg();

            System.out.println(students[i].name + "\t" + students[i].category + "\t" + students[i].grade());
        }
    }
}
